<?php 
		$user=$session->read('User');
		$colleageid=$session->read("colleageid");
?>
<div class="right_side_operate_area">

	<div class="right_side_title left">
		<h2>
			<?php 
					$colleagename=$session->read("colleagename");
					echo $html->link($colleagename,"/colleages/showcolleageinfo/".$colleageid);
			?>
		</h2>
		<div class="clear"></div>
	</div>
	
    <div class="right item_add_btn">
    <?php 
    	if($form->value('CgNew.id'))
    	{
    		$str_title=__("Edit",true);
		}
		else
		{
			$str_title=__("Add",true);
		}
		echo $html->link(__("Cancel",true).$str_title,"/colleages/news/");
    ?>
    </div>
    <div class="clear"></div>
    
</div>


<div class="right_side_scollbar">
    <div class="detail_info_panel">
    
    	<?php echo $form -> create('colleages', array('action' => 'editnews','type'=> 'post','onsubmit'=>'return  checkedinfo()') ); ?>
	    	<div class="details_item_line">
			      <div class="details_item">
				      <div class="form_left_title left">新闻标题：</div>
				      <div class="form_right_e_input left"><?php echo $form->text('CgNew.title');?></div>
				       <div id='titlemessage' style='display:none;' class="error_message">请填写新闻标题</div>
			      </div>
			</div>
    	
    		<div class="details_item_line">
			      <div class="details_item">
				      <div class="form_left_title left">重大新闻：</div>
				      <div class="form_right_e_input left"><?php echo $form->textarea('CgNew.content',array('class' => 'form_textarea'));?></div>
				       <div id='contentmessage' style='display:none;' class="error_message">请填写重大新闻</div>
			      </div>
			</div>
			
			<div class="details_item_line">
				<div class="details_item">
						<div class="form_left_title left"></div>
				        <div class="form_add_submit left">
				        	<?php echo $form->submit(__('Save',true), array("id"=>"addactive","name"=>"submit","class"=>"buttom","div"=>false));  ?>
				            <?php echo $form->hidden('CgNew.colleage_id',array("value"=>$colleageid)) ;?>
				        	<?php echo $form->hidden('CgNew.id') ?>
				        </div>
				</div>
		 </div>
    	
    </div>
</div>

<script>
function checkedinfo(){
		 if($("#CgNewTitle").val().trim() == '')
		 {
				$("#titlemessage").css('display','block');
				return false;
		  }
		  else
		  {
			 	 $("#titlemessage").css('display','none');
		  }
			 	  
		   if($("#CgNewDescribe").val().trim() == '')
		   {
				$("#describemessage").css('display','block');
				return false;
		  }
		  else
		  {
			 	 $("#describemessage").css('display','none');
		   }
			  
		   if($("#CgNewContent").val().trim() == '')
		   {
				$("#contentmessage").css('display','block');
				return false;
		  }
		  else
		  {
			 	 $("#contentmessage").css('display','none');
		   }
}
</script>